<?php
/**
 * 全局项加载
 * @copyright (c) iDoo All Rights Reserved
 */

error_reporting(7);
ob_start();
header('Content-Type: text/html; charset=UTF-8');

define('APP_ROOT', dirname(__FILE__));

if (extension_loaded('mbstring')) {
	mb_internal_encoding('UTF-8');
}

require_once APP_ROOT.'/data/config.php';
require_once APP_ROOT.'/include/lib/function.base.php';

define('ROLE_ADMIN', 'admin');
define('ROLE_MEMBER', 'member');
define('ROLE_VISITOR', 'visitor');

// 站点固定地址
define('APP_URL', 'http://fcs/');
// 解决前台多域名ajax跨域
define('DYNAMIC_APPURL', 'http://fcs/');

//模板库地址
define('TPLS_URL', APP_URL.'tpl/');
//模板库路径
define('TPLS_PATH', APP_ROOT.'/tpl/');

//模板URL
define('TEMPLATE_URL', TPLS_URL.'default/');
//模板路径
define('TEMPLATE_PATH', TPLS_PATH.'default/');


//公共资源URL
define('PUBLIC_URL', APP_URL.'public/');

$userData = array();
define('ISLOGIN',	LoginAuth::isLogin());
//用户角色
define('ROLE', ISLOGIN === true ? $userData['role'] : ROLE_VISITOR);
//用户ID
define('UID', ISLOGIN === true ? $userData['uid'] : '');


doStripslashes();
$CACHE = Cache::getInstance();